<?php 
if($mensaje){?>
<script>
    alert('<?php echo $mensaje ?>');
</script>

<?php }?>
<fieldset>
    <h1>Listar Remitos</h1>
    <p>Ingresar el Numero de Remito</p>
        
    <?php
    $atributos = array('id' => 'remito_listar_form', 'class' => 'form_remito_listar', 'name' => 'remito_listar_form');
    echo form_open('listar_remito/validarListarRemitos', $atributos);
    ?>
        
    <div id="labelCombo">Nº Remito:</div>
    <select name="remitos" id="select">
        <option value="-1">Seleccionar</option> 
        <?php
        foreach ($lista_remitos as $i => $datos) {
            echo "<option value='" . $datos['id_remito'] . "'>" . $datos['id_remito'] . "</option>";}?></select>    
    <div id="select">
        <input type="submit" id="registrar" value="Listar Remitos"/>
    </div>     
    <?php echo form_close() ?>
</fieldset>
<fieldset style="width: 900px;">
    <?php
    if ($numeroRemito == 0) {
        echo "<h2 style='text-align: center;'>No se selecciono ningun remito.</h2>";
    } else {?>
        <table id="tabla" cellspacing="0">
        <caption style="font-size: 13px; text-align: left; margin-bottom: 5px;"><?php echo anchor('http://www.panambi.com/rollo/index/' . $numeroRemito, 'Cargar Rollos al Remito ');?>
        <tr>
            <th class="elthini"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 1, keepRelationships: true, sortType: 'numeric'})" style="color:#333333;">ID Rollo</a></th>
            <th class="elth"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 2, keepRelationships: true})" style="color:#333333;">Especie</a></th>
            <th class="elth"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 3, keepRelationships: true, sortType: 'numeric'})" style="color:#333333;">Largo</a></th>
            <th class="elth"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 4, keepRelationships: true, sortType: 'numeric'})" style="color:#333333;">Circunferencia</a></th>
            <th class="elth"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 5, keepRelationships: true, sortType: 'numeric'})" style="color:#333333;">Metros Cubicos</a></th>
            <th class="elth"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 4, keepRelationships: true, sortType: 'numeric'})" style="color:#333333;">Estado Rollo</a></th>
            <th class="elthfin">Editar</th>
       
        </tr>
        <?php foreach($listar_rollos as $i=>$id){ ?>
        <tr>
            <td class="eltd" style="width: 100px;"><?php echo $id['idRollo'] ?></td>
            <td class="eltd" style="width: 100px;"><?php echo $id['nombre'] ?></td>
            <td class="eltd" style="width: 100px;"><?php echo $id['largo'] ?></td>
            <td class="eltd" style="width: 100px;"><?php echo $id['circunferencia'] ?></td>
            <td class="eltd" style="width: 150px;"><?php echo $id['m3_rollo'] ?></td>
            <td class="eltd" style="width: 150px;"><?php echo $id['estado'] ?></td>
            <td class="eltd" style="width: 100px;"><a href="<?php echo base_url().'editar_rollo/index/'.$id['idRollo']?>"  title="Editar"  alt="editar"  ><img src="<?php echo base_url() ?>css/images/edit.png" alt="" /></a></td>       
        </tr>
        <?php }?>
    </table>
    <? } ?>  
 </fieldset>  
    <!--          <div id="grid" style="font-size:15px;"></div> -->  
<fieldset>
    <h1>  <?php
    if ($total_cubico != 0)
        echo "Total: " . (round($total_cubico * 100) / 100)." M³";
        ?>
    </h1>
</fieldset> 
